package cn.edu.neusoft.yuejian12.Model;



import cn.edu.neusoft.yuejian12.Service.UserService;
import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * Created by 木子李 on 2017/9/27.
 */

public class UserModel {
    private Retrofit retrofit;
    public UserModel(){
        retrofit=new Retrofit.Builder()
                .baseUrl("http://172.24.10.175/")
                .addConverterFactory(GsonConverterFactory.create())
                .build();
    }
    public Call login(String str_user, String str_password)
    {
        UserService userService=retrofit.create(UserService.class);
        return  userService.getLogin(str_user,str_password);
    }
    public Call reg(String str_tel,String str_password,String str_again)
    {

        UserService userService=retrofit.create(UserService.class);
        return  userService.userRegister(str_tel,str_password);
    }
    public retrofit2.Call<Integer> getTeaState(String fan_id,int userid){
        UserService userService = retrofit.create(UserService.class);
        return  userService.getTeaState(fan_id,userid,"2","lgj98rfkiqvenhrk2o7oe2po81");
    }
    public retrofit2.Call<Integer> changeTeaState(int userid,String fan_id){
        UserService userService = retrofit.create(UserService.class);
        return  userService.changeClubState("lgj98rfkiqvenhrk2o7oe2po81",userid,fan_id,"2");
    }
}
